#include "kml_ipl_test.h"
#include <stdlib.h>
#include <stdio.h>
#include "kipl.h"


int kml_ipl_interp2d_01()
{
    const size_t xMin = 4;
    const size_t xMax = 2048;
    const size_t xSize = 4;
    const size_t yMin = 4;
    const size_t yMax = 2048;
    const size_t ySize = 4;
    const float xValLo = 1;
    const float xValHi = 2;
    const float yValLo = 1;
    const float yValHi = 2;
    float xArr[4] = {1,1.33,1.67,2};
    float yArr[4] = {1,1.33,1.67,2};
    float* zArr = (float*)malloc(xSize * ySize * sizeof(float));
    float x = 1;
    float y = 1;
    float z = 0;
    kml_float_interp2d *interp = kml_float_interp2d_alloc(kml_float_interp2d_bicubic, xSize, ySize);
    kml_interp_accel *xacc = kml_interp_accel_alloc();
    kml_interp_accel *yacc = kml_interp_accel_alloc();
    kml_float_interp2d_init(interp, xArr, yArr, zArr, xSize, ySize);
    z = kml_float_interp2d_eval(interp, xArr, yArr, zArr, x, y, xacc, yacc);


    return 1; // 成功
}